<?php
    namespace Core\ORM\Requete;
    /**
     * Permet la création d'un Delete SQL
     *
     * @author mpetrini
     */
    class Delete extends \Core\ORM\Requete\Requete {
        /**
        * Servira à générer la Requête SQL 
        * 
        * @return string
        */
        public function creation() {
            $this->sql =    'DELETE FROM `'.$this->from->getNom().'`';
            $this->sql .= $this->creationWhere();
            $this->sql .=   ';';
            return $this->sql;
        }
        /**
        * Execute une requête SQL DELETE préparée
        * 
        * @return int
        */
        public function execution() {
            parent::execution();
            if(empty($this->sql)) {
                $this->creation();
            }
            return \Core\ORM\ORMClasse::$lien->exec($this->sql);
        }
    }
?>